package com.gitee.starblues.grape.core.builder;


import com.gitee.starblues.grape.core.domain.user.RebateDrawLog;
import com.gitee.starblues.grape.repository.databases.entity.RebateDrawLogPo;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

public class RebateDrawLogBuilder {
	public static RebateDrawLogPo build(RebateDrawLog source) {
		RebateDrawLogPo po = new RebateDrawLogPo();
		BeanUtils.copyProperties(source, po);
		return po;
	}

	public static List<RebateDrawLog> build(List<RebateDrawLogPo> listPo) {
		List<RebateDrawLog> drawLogs = new ArrayList<RebateDrawLog>();
		for (RebateDrawLogPo po : listPo) {
			drawLogs.add(RebateDrawLogBuilder.build(po));
		}
		return drawLogs;
	}

	public static RebateDrawLog build(RebateDrawLogPo source) {
		RebateDrawLog drawLog = new RebateDrawLog();
		BeanUtils.copyProperties(source, drawLog);
		return drawLog;
	}

}
